<script setup>
// 导入
import { reactive } from 'vue'
 // 执行函数 传入参数 变量接收
 const state = reactive({
   msg:'this is old msg'
 })
 const setState = ()=>{
   // 修改数据更新视图
   console.log("haha")
   state.msg = 'this is new msg'
 }
</script>
<template>
    <div>
        {{ state.msg }}
        <button @click="setState">change msg</button>
    </div>
</template>
<style scoped>

</style>